<?php require_once(dirname(__FILE__).'/../include/config.inc.php');
//获取用户信息
require_once "function.php";
$userInfo="";
if(isset($uid)){

		//有session 从数据库中读取用户名信息
	 	//$openid_str=$_SESSION['openid'];
		$row = $dosql->GetOne("SELECT * FROM `#@__user` WHERE id='$uid'");
			if(is_array($row) && isset($row['id'])){
				// 返回用户 id 
				$id=$row['id'];
				$_SESSION['id'] = $id;
				$adcode=$row['adcode'];
				$userInfo=$row;
			}
}



?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo $cfg_webname;?> </title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="description" content="<?php echo $cfg_webname;?>">
<link rel="stylesheet" href="lib/weui.min.css">
<link rel="stylesheet" href="css/jquery-weui.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/demos.css">
</head>
<body ontouchstart>
<div class="top"><a href="main.php"><img src="images/top.jpg" width="100%"></a> </div>
<!-- 地址信息 --> 

<!-- 报修信息 -->
<div class="main">
  <div class="weui-cells__title"><i class="fa fa-id-card-o" aria-hidden="true"></i>快速报修</div>
  <div class="weui-flex service-list">
    <div class="weui-flex__item"><a href="apply.php?type=1"><img src="images/yitiji.jpg" width="100%"/><p>多媒体教学一体机</p></a></div>
    <div class="weui-flex__item"><a href="apply.php?type=2"><img src="images/zhantai.jpg" width="100%"/><p>壁挂展台</p></a></div>
  </div>
  <div class="weui-flex">
    <div class="weui-flex__item"><a href="javascript:;" id="saoma"><img src="images/saosao.jpg" width="100%"/><p> 扫条码快速报修</p></a></div>
    <div class="weui-flex__item"><a href="school.php"><img src="images/faq.jpg" width="100%"/><p>常见问题自助解决</p></a></div>
  </div>
</div>
<div class="clear"></div>
<script src="lib/jquery-2.1.4.js"></script> 
<script src="lib/fastclick.js"></script> 
<script>
  $(function() {
    FastClick.attach(document.body);
  });
</script> 
<script src="js/jquery-weui.js"></script> 
<script src="js/city-picker.js"></script> 
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script>
  wx.config({
    debug: false,
    appId: '<?php echo $signPackage["appId"];?>',
    timestamp: <?php echo $signPackage["timestamp"];?>,
    nonceStr: '<?php echo $signPackage["nonceStr"];?>',
    signature: '<?php echo $signPackage["signature"];?>',
    jsApiList: [
      // 所有要调用的 API 都要加到这个列表中
	    'onMenuShareTimeline',
        'onMenuShareAppMessage',
        'onMenuShareQQ',
        'onMenuShareWeibo',
		'openAddress',
		'chooseImage',
		'previewImage',
		'uploadImage',
		'downloadImage',
		'scanQRCode'
    ]
  });
  wx.ready(function () {
	  // 分享
	  var urlurl=window.location.href;
	  var shareData = {
    	   title: '翰之博售后服务-在线报修',
    	   desc: '在线报修，2小时内响应。48-72小时内完修',
           link: urlurl,
           imgUrl: 'https://www.hanzhibo.cn/wx/images/yitiji.jpg'
	  };
	  
	  
	  wx.onMenuShareAppMessage(shareData);
	  wx.onMenuShareTimeline(shareData);
	  wx.onMenuShareQQ(shareData);
	  wx.onMenuShareQZone(shareData);
	  
	   $("#saoma").on("click",function(){  
	   		$.toast("请扫描机身条形码", "text", function() {
			  //do something
			  	  wx.scanQRCode({
					needResult: 1, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
					scanType: ["barCode"], // 可以指定扫二维码还是一维码，默认二者都有
					success: function (res) {
					var result = res.resultStr; // 当needResult 为 1 时，扫码返回的结果
					if(result.length>10){
						window.location.href = "saoma.php?ma="+encodeURI(result)
					}
					}
				});
			});

	   })
	  
	  
  })
</script>
 <div class="sub_btn"></div>
<?php require_once('footer.php'); ?>